scroll to element jquery

88

scroll to element jquery -

$('html, body').animate({
  scrollTop: $("#grepperRocks").offset().top
});

jquery scroll to element -

$("#button").click(function() {
    $([document.documentElement, document.body]).animate({
        scrollTop: $("#elementtoScrollToID").offset().top
    }, 2000);
});

Comments

Submit
0 Comments